package com.sg.business.organization.command;

import java.util.Map;

import org.eclipse.core.commands.Command;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.handlers.HandlerUtil;

import com.mobnut.db.model.PrimaryObject;
import com.sg.business.model.Role;
import com.sg.business.model.RoleAssignment;
import com.sg.widgets.command.AbstractNavigatorHandler;
import com.sg.widgets.part.IEditablePart;
import com.sg.widgets.viewer.ViewerControl;

public class RemoveRoleAndRoleAssignment extends AbstractNavigatorHandler {

	@Override
	protected void execute(PrimaryObject selected, IWorkbenchPart part,
			ViewerControl vc, Command command, Map<String, Object> parameters,
			IStructuredSelection selection) {
//		if(selected instanceof Role){
//			Role role = (Role) selected;
//			
//		} else if(selected instanceof RoleAssignment){
//			RoleAssignment roleAssignment = (RoleAssignment) selected;
//			
//		}
//		vc.doRefresh();
		if(part instanceof IEditablePart){
			((IEditablePart)part).doDelete();
		}
	}

}
